﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace t09typechange
{
    class Program
    {
        static void Main(string[] args)
        {
            double d = 10.23f;
            int a = (int)d;
            Console.WriteLine($"强制类型转换：{a}");
            Console.WriteLine("============");

            //字符串与数值间的转换
            string strNumber = "123";
            int iC=int.Parse(strNumber)；
            //int iC-int32.Prase(strNumber);
             Console.WriteLine( $"字符串转换:{iC}");
            //int iD = int.Parse("123s");
            //out  int _iD;
            //bool bD = int.TryParse("123s", out _iD);
            Console.WriteLine("============");


            //转换类
            int iE = Convert.ToInt32("12");
            Console.WriteLine($"Convert类转换字符串{iE}");

            //数值转字符串
            Console.WriteLine($"数值转字符串{12.ToString()}");

            Console.WriteLine("============");


        }
    }
}
